
<template>
	<view class="lunbo">
			<view class="lunbo_t">
				<text>全景思政</text>
				<view class="lunbo_b">
					 <scroll-view :scroll-x="true" style="white-space: nowrap;">
							 <view class="box1" v-for="(itam,index) in quan" @click="tz(itam.id,itam.name)" :key="index">
								 <image :src="itam.faceUrl" mode=""></image>
								 <text>{{itam.name}}</text>
							</view>
					 </scroll-view>
				</view>
			</view>
			<view class="lunbo_t">
				<text>VR体验</text>
				<view class="lunbo_b">
					 <scroll-view :scroll-x="true" style="white-space: nowrap;">
							 <view class="box1" v-for="(itam,index) in sizheng" @click="sz(itam.id,itam.name)">
								 <image :src="itam.faceUrl" mode=""></image>
								 <text>{{itam.name}}</text>
							</view>
					 </scroll-view>
				</view>
			</view>
			<view class="lunbo_t box2">
				<text>教学资源</text>
				<view class="lunbo_bx">
					 <scroll-view :scroll-x="true" style="white-space: nowrap; ">
<!-- 							 <view class="box1" v-for="(itam,index) in jx" @click="lb(itam.id)">
								 <image :src="itam.faceUrl" mode=""></image>
								 <text>{{itam.name}}</text>
							</view> -->
						<view style="display: flex;padding: 0 20rpx 0 40rpx;">
							<view class="lunbo_bx_item">
								<image  src="../../static/arr3_icon.png" @click="toTeach(1)"></image>
								<view style="font-size: 24upx;">思政课程</view>
							</view>
							<view  class="lunbo_bx_item">
								<image  src="../../static/arr_icon.png" @click="toTeach(2)"></image>
								<view style="font-size: 24upx;">课程思政</view>
							</view>
							<view class="lunbo_bx_item">
								<image src="../../static/arr1_icon.png" @click="toTeach(3)"></image>
								<view style="font-size: 24upx;">影视资源</view>
							</view>
							<view class="lunbo_bx_item">
								<image src="../../static/arr2_icon.png" @click="toTeach(4)"></image>
								<view style="font-size: 24upx;">思政刊物</view>
							</view>
							<view class="lunbo_bx_item">
								<image src="../../static/arr31_icon.png" @click="toTeach(5)"></image>
								<view style="font-size: 24upx;">精神谱系</view>
							</view>
						</view>
					 </scroll-view>
				</view>
			</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				quan:[],
				sizheng:[],
				jx:[],
				cokei : uni.getStorageSync('cokei')
			}
		},
		created() {
			//首页
			let baseUrl = uni.getStorageSync('baseUrl');
			if(!baseUrl){
				this.toast('请先登录');
				setTimeout(function () {
					// uni.hideLoading();
					uni.navigateTo({
						url:"/pages/index/logo/logo",
					})
				}, 1500);
			}else{
				this.shuju()
			}
		},
		methods: {
			toTeach(num){
				if(num==1){
					uni.navigateTo({
						url:'/pages/index/jiaoxue/jiaoxuefenlei'
					})
					/*
					if(this.cokei == 2){
						uni.navigateTo({
							url:'/pages/index/jiaoxue/jiaoxue'
						})
					}
					else{
						this.toast('仅供教师使用');
					}
					*/
				}else if(num==2){
					//思政课程
					// if(this.cokei == 2){
					// uni.navigateTo({
					// 	url:'/pages/index/jiaoxue/jiaoxue2'
					// })
					// }else{
					// 	this.toast('仅供教师使用');
					// }
					//跳转思政资源云
					// uni.navigateTo({
					// 	url:'/pages/cle/mindSource'
					// })
				}else if(num==3){
					uni.navigateTo({
						url:'/pages/index/jiaoxue/jiaoxue3'
					})	
				}else if(num==4){
					this.toast('即将上线');
				}else if(num==5) {
					uni.navigateTo({
						url:'/pages/index/psychotomy/psychotomy'
					})	
				}
									
			},
			/* 数据加载 */
			shuju(){
				let that = this;
				// let headers={
				// 	  "Content-Type":"application/x-www-form-urlencoded"
				// }
				let params = {
					"pageNo":1,
					"pageSize":99999
				}

				that.pyReq(that.$http.getVoviTypeInfo,{},function(res){
						  that.quan = res.result
				});
				//vr体验
				that.pyReq(that.$http.getVrTypeInfo,{},function(res){
						  that.sizheng = res.result
				});
				//教学资源
				that.pyReq(that.$http.getMindClazzList,params,function(res){
						  that.jx = res.result
				});
			},
			
			tz(id,na){
				console.log(na)
				console.log(id)
				uni.navigateTo({
					url:'../../pages/index/ziye/ziye_xqli?id='+id+'&na='+na
				})
			},
			sz(id,na){
				uni.navigateTo({
					url:'../../pages/index/ziye/vr_xqli?id='+id+'&na='+na
				})
			},
			lb(id){
				uni.navigateTo({
					url:'../../pages/index/jiaoxue/kechenglist?id='+id
				})
			}
			
		}
		
	}
</script>

<style>
	.lunbo_b{
		margin-top: 20upx;
		margin-bottom: 20upx;
	}
	.lunbo_bx{
		margin-top: 20upx;
		margin-bottom: 20upx;		
		width: 100%;
		height: 150upx;
	}
	.lunbo_bx > view{
		font-size: 20upx;
		float: left;
		margin-left: 70upx;
		width: 100upx;
		text-align: center;
	}
	.lunbo_bx image{
		width: 100upx;
		height: 100upx;
		/* float: left; */
		/* margin-left: 70upx; */
	}
	.lunbo_z view{
		width: 250upx;
	}
	.lunbo_t>text{
		font-size: 30upx;
		padding-left: 20upx;
	}
	.box2 .box1{
		width: 201upx;
		box-shadow: none;
	}
	.box2 .box1 image{
		height: 266upx;
	}
		.box1 {
	        display: inline-block;
	        width: 252upx;
	        background: #FFFFFF;
			border-radius: 10upx;
			overflow: hidden;
			box-shadow:0px 1px 8px #D9D9D9;
			margin: 0 20upx 0 20upx;
	    }
		.box1>image{
			height: 163upx;
		}
		.box1>text{
			display: block;
			text-align: center;
			font-size: 26upx;
			padding-bottom: 15upx;
		}
		.lunbo_bx_item {
			width: 25%;
		}
</style>

